
<!DOCTYPE HTML>
<html>
<head>
<title>后台登录</title>
<link href="__PUBLIC__/tlogin/css/style.css" rel="stylesheet" type="text/css" media="all"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="keywords" content="后台登录" />
<meta name="description" content="后台登录" />
	<script src="__PUBLIC__/home/js/jquery-2.1.1.min.js" type="text/javascript"></script>

    <script src="__PUBLIC__/layer/layer.js" type="text/javascript"></script>
</head>

<style>

#denglu{
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    padding: 13px 0;
    background: #ff3366;
    display: inline-block;
    width: 100%;
    outline: none;
    border: 2px solid #ff3366;
    cursor: pointer;
    text-transform: uppercase;

}

</style>

<body>
<div class="login-form">
	
			<h1>打赏平台登录</h1>
			<div class="login-top">
			<form>
				<div class="login-ic">
					<i></i>
					<input type="text" id="username"  placeholder="用户名" />
					<div class="clear"> </div>
				</div>
				<div class="login-ic">
					<i class="icon"></i>
					<input type="password"  id="password" placeholder="请输入密码" />
					<div class="clear"> </div>
				</div>
				
				<div class="login-ic">
					<i class="icon"></i>
					<input type="password"  id="repass" placeholder="请重复输入密码" />
					<div class="clear"> </div>
				</div>
				<div class="login-ic">
					<i class="icon"></i>
					 <input type="password"  id="tixianpwd" placeholder="请输入提现密码" class="login_txtbx"/>
					<div class="clear"> </div>
				</div>
				
				<div class="login-ic">
					<i class="icon"></i>
					 <input type="password"  id="yaoqingma" placeholder="请输入邀请码" class="login_txtbx"/>
					<div class="clear"> </div>
				</div>
			<!--	<div class="login-ic">
					<i class="icon"></i>
					<input type="password"  placeholder="确认密码" onFocus="this.value = '';" onBlur="if (this.value == '') {this.value = 'password';}"/>
					<div class="clear"> </div>
				</div>-->
				<div class="login-ic">
					<i class="icon"></i>
					<input type="text" id="code"  placeholder="请输入验证码" style="width:180px;background:none;border:none;height:10px;line-height:10px;font-size:14px;color:#fff;outline:none;"/>
					 <img src='{:U("Login/verify")}' onClick="this.src=this.src+'?'+Math.random()"/>
				</div>
				<div class="log-bwn">
					<input type="button" id="denglu" style="cursor:pointer;" onClick="dosubmit()"  value="登录" >
				</div>
				
			   <div class="layui-login-text">
					<p style="text-align:right;margin-top:10px;"><a href="{:U('Login/login')}" style="color:#fff;">已有账号现在登录</a></p>
			   </div>

				</form>
			</div>
			
</div>		
</body>
</html>
<script>
  
  function dosubmit(){
  
    var id="{$id}";
  
    var verify=$('#code').val();
    var username=$('#username').val();
	var password=$('#password').val();
	var tixianpwd=$('#tixianpwd').val();
	var repass=$('#repass').val();
	var yaoqingma=$("#yaoqingma").val();
	
	if(username==""){
	
	  layer.msg('用户名不能为空', {icon: 5});return;
	}
	
	if(password==""){
	
	  layer.msg('密码不能为空', {icon: 5});return;
	
	}
	
	if(password!=repass){
	
	  layer.msg('两次密码输入不一致', {icon: 5});return;
	
	}
	
	if(verify==""){
	
	   layer.msg('验证码不能为空', {icon: 5});return;
	
	}
	
	
	
	if(tixianpwd==""){
	
	  layer.msg('提现密码不能为空', {icon: 5});return;
	
	}
	
	$.post("{:U('Login/reg')}",{"username":username,"password":password,'verify':verify,"tixianpwd":tixianpwd,"repass":repass,"upid":id,"yaoqingma":yaoqingma},function(re){
	  
	  if(re==1){
	    layer.alert('恭喜您注册成功', {icon: 6},function(){
		
		  location.href="{:U('Index/index')}";
		
		});
		
	  }else if(re==2){
	  
	      layer.msg('注册失败', {icon: 5});return;
	  
	  }else if(re==4){
	  
	      layer.msg('验证码错误', {icon: 5});return;
	  
	  }else if(re==6){
	  
	      layer.msg('提现密码或者注册密码不能为空', {icon: 5});return;
	  
	  }else if(re==7){
	  
	      layer.msg('用户名不能为空', {icon: 5});return;
	  
	  }else if(re==5){
	  
	      layer.msg('两次密码输入不一样', {icon: 5});return;
	  
	  }else if(re==8){
	  
	      layer.msg('邀请码不存在', {icon: 5});return;
	  
	  }else if(re==3){
	  
	      layer.msg('该用户名已经存在', {icon: 5});return;
	  
	  }
	
	
	})
  
  
 
  
  }

</script>
